{extends file='layout/list-base.tpl'}

{block name='left-content'}
<div class="heading-bar">
    <h2>Truyện {$book.name|escape}</h2>
    <span class="h-line"></span>
</div>
<!-- Start Main Content -->
<section class="span9 first">
  <!-- Start Ad Slider Section -->
  <div class="r-post">
    <div class="r-img-title">
      <img src="{$base_url}public/frontend/hinh-anh/lagre/{$book.image_filename}" alt=""/>
      <div class="r-det-content">{$book.description}</div>
    </div>
  </div>
  <!-- End Ad Slider Section -->
  
  <!-- Start List Five Chapter Last -->
   <section class="list-holder">
   <h3>Chương Mới Nhất Của Truyện</h3>
    <ul class="side-list">
      {foreach from=$listChapterFive item=chapterFive}
      <li><a href="{$base_url}truyen-{$category.uname}/{$book.uname}/chuong-{$chapterFive.no}-{$chapterFive.uname}.html">Chương {$chapterFive.no} : {$chapterFive.name}</a></li>
      {/foreach}
    </ul>  
  </section>
  <!-- End List Five Chapter Last --> 
   
  <!-- Start Grid View Section -->
  <section class="list-holder">
    <h3 id="truyen">Danh Sách Chương</h3>
    <div class="blog-footer">
      <div class="pagination">  
        {$pageList}
      </div>
      <br />
      <div style="float:left;width:100%">
        <form class="noMargin" method="post" id="frmGotoPage1" onsubmit="return goto_page(1)">
          Chuyển nhanh đến trang <input type="text" style="width:40px;" name="page" id="page1" class="gotopage"> 
          <input class="buttonChange" type="submit" value="Chuyển"> 
        </form>
      </div>
      <div class="clearboth"></div>
    </div>
    {foreach from=$volumeList item=volume}
        <h4>Quyển {$volume.volume_no|escape} : {$volume.volume_name|escape}</h4>
        <ul class="side-list">
          {foreach from=$volume.chapterList item=chapter}
          <li><a href="{$base_url}truyen-{$category.uname}/{$book.uname}/chuong-{$chapter.chapter_no}-{$chapter.chapter_uname}.html">Chương {$chapter.chapter_no} : {$chapter.chapter_name}</a></li>
          {/foreach}
        </ul>
    {/foreach}
  </section>
  <div class="blog-footer">
    <div class="pagination">
      {$pageList}
    </div>
    <br />
      <div style="float:left;width:100%">
        <form class="noMargin" method="post" id="frmGotoPage2" onsubmit="return goto_page(2)">
          Chuyển nhanh đến trang <input type="text" style="width:40px;" name="page" id="page2" class="gotopage"> 
          <input class="buttonChange" type="submit" value="Chuyển"> 
        </form>
      </div>
      <div class="clearboth"></div>
  </div>
  <!-- End Grid View Section -->
</section>
<!-- End Main Content -->
<script type="text/javascript">
function goto_page(id)
{
  if ($('#page' + id).val() == '')
  {
    alert('Vui lòng nhập số trang cần chuyển đến');
    $('#page' + id).focus();
    return false;
  }
  
  var den_trang = parseInt($('#page' + id).val());
  
  if (den_trang <= 0)
  {
    alert('Số trang không hợp lệ');
    $('#page' + id).focus();
    return false;
  }

  location.href = '{$base_url}truyen-{$category.uname}/{$book.uname}/trang-' + den_trang + '.html#truyen';
  return false;
}
</script>
{/block}
